﻿using MvvmFx.Common.ViewModels;
using MvvmFx.Common.ViewModels.Commands;
using Pomodoro.ViewModels.Models;

namespace Pomodoro.ViewModels
{
    public class TaskViewModel : SelectableViewModel
    {
        private readonly DelegateCommand addTaskCommand;
        private string description;
        private int numberEstimated;
        private int numberDone;

        public TaskViewModel()
        {
            this.addTaskCommand = new DelegateCommand(OnAddTaskExecuted);
        }

        private void OnAddTaskExecuted()
        {
            //DataService.AddTask(
            //    new Task()
            //            {
            //                Description = description,
            //                Estimated = numberEstimated
            //            });
        }
      
        /// <summary>
        /// Gets or sets the value of the <see cref=”Description”/> property.
        /// </summary>
        public string Description
        {
            get { return description; }
            set
            {
                if (description != value)
                {
                    description = value;
                    OnPropertyChanged("Description");
                }
            }
        }

        /// <summary>
        /// Gets or sets the value of the <see cref=”NumberEstimated”/> property.
        /// </summary>
        public int NumberEstimated
        {
            get { return numberEstimated; }
            set
            {
                if (numberEstimated != value)
                {
                    numberEstimated = value;
                    OnPropertyChanged("NumberEstimated");
                }
            }
        }

        /// <summary>
        /// Gets or sets the value of the <see cref=”NumberDone”/> property.
        /// </summary>
        public int NumberDone
        {
            get { return numberDone; }
            set
            {
                if (numberDone != value)
                {
                    numberDone = value;
                    OnPropertyChanged("NumberDone");
                }
            }
        }

        /// <summary>
        /// Gets the value of the <see cref=”AddTaskCommand”/> property.
        /// </summary>
        public DelegateCommand AddTaskCommand
        {
            get { return addTaskCommand; }
        }
    }
}